<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ include file="../common/tag.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>阅学网</title>
<meta name="Keywords" content="">
<meta name="description" content="">
<%@ include file="../common/common.jsp"%>
<link href="css/public/star.css?v=31.0" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/public/resource/resource.js?v=3135"></script>
</head>
<body>
	<jsp:include page="../top.jsp"></jsp:include>
	<div class="step-detail" >
		<span>
			<a href="public/index">首页</a>>>
			<a href="public/resource">文件下载</a>
		</span>
	</div>
	<div class="yc_container">
		<div class="yc_content_inner resource-content-inner">
			<div style="float: left;width: 710px;">
				<div class="resource-content-detail-type" >
					<img alt="${rf.resourceTitle }"style="width: 45px;" src="images/${rf.fileType }.png">
				</div>
				<div class="resource-content-detail-info" >
					<div class="resource-content-detail-info-title">${rf.resourceTitle }</div>
					<div class="resource-content-detail-info-desc">${rf.resourceDescription }</div>
					<div id="file"  class="resource-content-detail-info-file">
						<ul>
							<li>下载: ${rf.downloadCount }次</li>
							<li>文件大小: ${rf.resourceSize }</li>
							<li>上传时间: <fmt:formatDate value="${rf.uploadDate }"	type="both" pattern="yyyy-MM-dd HH:mm:ss" /></li>
							<li>下载所需积分:${rf.score }</li>
						</ul>
					</div>
				</div>
				<div class="resource-content-detail-info-comm">
					<div style="float: left; margin-top: 5px;">
						<ul style="float: left; width: 200px;">
							<c:forEach begin="1" end="${rf.commentScore }" var="start">
								<li style="float: left; margin-right: 2px;"><img src="images/light.png"></li>
							</c:forEach>
							<c:forEach begin="1" end="${5-rf.commentScore }" var="start">
								<li style="float: left; margin-right: 2px;"><img src="images/gray.png"></li>
							</c:forEach>
						</ul>
						<div class="resource-comm">
							<c:if test="${empty user}">
									<a href="javascript:void(0);" onclick="javascript:$.util.login()" class="downlod">下载</a>
									<a href="javascript:void(0);" onclick="javascript:$.util.login()" class="comment">评论</a>
									<a href="javascript:void(0);" onclick="javascript:$.util.login()" class="shoucang">收藏</a>
							</c:if>
							<c:if test="${!empty user}">
									<a href="javascript:resourceHandler.resourceDownload(${rf.id });"  class="downlod">下载</a>
									<a href="javascript:resourceHandler.starShow();"  class="comment">评论</a>
									<a href="javascript:resourceHandler.resourceCollection(${rf.id });"  class="shoucang">收藏</a>
							</c:if>
						</div>
					</div>
				</div>
				<div class="pinglun-list" style="float: left;width: 710px;margin-top: 20px;">
						<ul>
							<c:forEach items="${commentList }" var="comment">
								<li>
									<div style="float: left; width: 60px; height: 60px;">
										<img style="border-radius: 50%; width: 45px; height: 45px;" src="public/user/showPicture/${comment.creater }" />
									</div>
									<div style="width: 600px; float: left;">
										<div class="pinglun-date">
											${comment.chName}:&nbsp;&nbsp;
											<fmt:formatDate	value="${comment.commentDate}" pattern="yyyy-MM-dd HH:mm:ss" />
										</div>
										<p class="pinglun-comment">${comment.commentContent }</p>
									</div>
								</li>
							</c:forEach>
						</ul>
				</div>
				<div class="page" style="float: left;width: 710px;">
						 <span><a href="public/article/articleTypeList/${articleTypeId}/pageNow=1">首页</a></span>
						         <c:choose>
						                 <c:when test="${page.pageNow -1 >0}">
						                   			<span><a href="public/article/articleTypeList/${articleTypeId}/pageNow=${page.pageNow-1}">上一页</a></span>
						                   	</c:when>
						          </c:choose>
						            <c:forEach begin="1" end="${page.totalPageCount}" var="pageIndex">
						                   	 <c:choose>
						                   			<c:when test="${page.pageNow==pageIndex}">
						                   					<span><a href="javascript:void(0);" style="float: left;background:#EAEAEA; ">${pageIndex }</a></span>
						                   			</c:when>
							                   	  <c:otherwise>
							                   				<span><a href="public/article/articleTypeList/${articleTypeId}/pageNow=${pageIndex}" target="_self">${pageIndex }</a></span>
							                   	</c:otherwise>
						                   </c:choose>
						                </c:forEach>
						                 <c:choose>
						                   			<c:when test="${page.pageNow <page.totalPageCount}">
						                  				<span><a href="public/article/articleTypeList/${articleTypeId}/pageNow=${page.pageNow+1 }" target="_self">下一页</a></span>
						                   			</c:when>
						                 </c:choose>
						                 <span><a href="public/article/articleTypeList/${articleTypeId}/pageNow=${page.totalPageCount}">末页</a></span>
					</div>
			</div>
			<div class="similar-resources">
				<div class="similar-resources-title" >
					<span>相似资源</span>
				</div>
				<div>
					<ul>
						<c:forEach items="${rfsList }" var="rfList">
							<li><a href="public/resource/detail/${rfList.id }">${rfList.resourceTitle }</a></li>
						</c:forEach>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<jsp:include page="../bottom.jsp"></jsp:include>
	<form id="resource-comment-form">
		<div id="star-popDiv" class="star-mydiv" style="display: none;">
			<div class="star-titleDiv">&nbsp;&nbsp;友情提示-评价
				<a class="star-close" href="javascript:resourceHandler.starCancel();">
					<img src="images/close.png">
				</a>
			</div>
			<div style="margin-left: 0px;" id="star-div">
					<img src="images/gray.png" /> 
					<img src="images/gray.png" /> 
					<img src="images/gray.png" /> 
					<img src="images/gray.png" /> 
					<img src="images/gray.png" />
					<span></span>
			</div>
			<input type="hidden" id="commentScore"	name="commentScore" />
			<textarea rows="4"  name="commentContent" id="commentContent"></textarea>
			<button onclick="resourceHandler.resourceComment(${rf.id});return false;" class="resource-comment-submit">提交</button>
			<span id="comment-result"></span>
		</div>
		<div id="star-bg" class="star-bg" style="display: none;"></div>
	</form>
</body>
</html>
